package com.sg.business.commons.editingsupport;

import com.sg.business.commons.operation.handler.vault.ReadDocument;
import com.sg.business.model.Deliverable;
import com.sg.business.model.Document;
import com.sg.widgets.MessageUtil;
import com.sg.widgets.commons.editingsupport.CellClickListener;

public class WorkReadDocEditingSupportor extends CellClickListener {

	@Override
	protected void selected(Object element, String columnId) {
		if (element instanceof Deliverable) {
			try {
				Deliverable deliverable = (Deliverable) element;
				Document document = deliverable.getDocument();
				if (document == null) {
					return;
				}
				 ReadDocument readDocument = new ReadDocument();
				 readDocument.readDocument(document);
			} catch (Exception e) {
				MessageUtil.showToast(e);
			}
		}
	}

}
